package com.serviceprovider.business.module.admin.role.model;

//~--- non-JDK imports --------------------------------------------------------

import com.serviceprovider.business.module.admin.user.model.Saveable;

public class RoleHierarchy extends Saveable {

    /**
     *
     */
    private static final long serialVersionUID = 5969632253579815549L;
    private int               role1;
    private int               role2;
    private String            sign;

    public int getRole1() {
        return role1;
    }

    public void setRole1(int role1) {
        this.role1 = role1;
    }

    public int getRole2() {
        return role2;
    }

    public void setRole2(int role2) {
        this.role2 = role2;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof RoleHierarchy)) {
            return false;
        }

        RoleHierarchy b  = (RoleHierarchy) obj;
        boolean       eq = ((id == null) && (b.id == null)) || ((id != null) && id.equals(b.id));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        return (id != null)
               ? id.hashCode()
               : 0;
    }
}



